package flc.ast.dialog;

import android.content.Context;
import android.graphics.Color;
import android.graphics.Rect;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.view.ViewTreeObserver;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.blankj.utilcode.util.ConvertUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;
import com.lxj.xpopup.core.AttachPopupView;

import java.util.ArrayList;
import java.util.List;

import flc.ast.R;
import stark.common.basic.view.container.StkLinearLayout;

public class EditDialog extends AttachPopupView implements View.OnClickListener {

    private TextView tvDelete, tvShare;

    public EditDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        initView();
    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.dialog_record_edit;
    }

    protected void initView() {
        tvDelete = (TextView) findViewById(R.id.tvDelete);
        tvShare = (TextView) findViewById(R.id.tvShare);

        tvDelete.setOnClickListener(this);
        tvShare.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.tvDelete:
                dismiss();
                if (listener != null) {
                    listener.onClickDelete();
                }
                break;
            case R.id.tvShare:
                dismiss();
                if (listener != null) {
                    listener.onClickShare();
                }
                break;
        }
    }

    private IListener listener;

    public void setListener(IListener listener) {
        this.listener = listener;
    }

    public interface IListener {
        void onClickDelete();

        void onClickShare();
    }
}
